function m=four4(D,d,n)
l=0;
for y=1:n
    x=sqrt(D*y^2+d);
    if(x==floor(x)&&x<n)
        l=l+1;
        m(:,l)=[x,y,x+y,x+2*y,x-y];
    end
end
end

%four(3,1,10000)